#!/usr/bin/python
# -*- coding: utf-8 -*-

import sqlite3
import os 
import sys


def fill_db(dbname):
    conn = sqlite3.connect(dbname)
    c = conn.cursor()
    c.execute('''CREATE TABLE BAcounts (start_date text, duration integer, amount real, rate real, bank text)''')
    c.execute("INSERT INTO BAcounts VALUES ('2013-03-10', 6, 619.29, 3.08, 'SPD')")
    c.execute("INSERT INTO BAcounts VALUES ('2013-04-10', 12, 828, 3.3, 'SPD')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-08-01', 12, 70, 3.3, 'SPD')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-06-30', 60, 4000.26, 5.1, 'SPD')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-08-01', 60, 3000, 4.75, 'SPD')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-07-04', 60, 1001, 5.1, 'SPD')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-5-1', 24, 900, 4.4, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-5-2', 36, 200, 5, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-6-11', 60, 1300.00, 5.10, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-7-14', 60, 600, 4.75, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-7-21', 36, 205.59, 4.25, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-7-22', 60, 300, 4.75, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-8-1', 60, 750, 4.75, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-8-1', 60, 600, 4.75, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2013-4-20', 12, 4100.90, 3.25, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-12-9', 6, 3000.00, 3.05, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2013-03-07', 12, 6403.68, 3.25, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2013-04-05', 36, 2609, 4.25, 'CCB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-05-01', 24, 800, 4.4, 'ICBC')")
    c.execute("INSERT INTO BAcounts VALUES ('2013-02-02', 12, 1863, 3.3, 'MB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-05-01', 24, 2000, 4.4, 'MB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-05-01', 36, 3000, 5, 'MB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-05-01', 36, 300, 5, 'MB')")
    c.execute("INSERT INTO BAcounts VALUES ('2012-08-01', 60, 67, 4.75, 'MB')")
    conn.commit()
    conn.close()

dbname = sys.argv[1]
fill_db(dbname)




